package router

import (
	"sensor/service"
	Util "sensor/util"

	"github.com/gin-gonic/gin"
)

func Router() *gin.Engine {
	r := gin.Default()
	// 用户登录
	r.POST("/login", service.Login)
	r.Use(Util.AuthMiddleware())
	r.POST("/valid_token", service.ValidToken)
	r.GET("/getTotal", service.GetTotal)
	r.POST("/filterData", service.FilterData)
	r.POST("/addCollection", service.AddCollection)
	return r
}
